package com.buercorp.wangyu.file;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.nio.charset.Charset;

/**
 * 字节打印流
 * @author liyiyu
 */
public class FileTest13 {
    public static void main(String[] args) throws FileNotFoundException {
        // 创建字节流打印对象
        PrintStream ps = new PrintStream(new FileOutputStream("filejava/java8.txt"), true, Charset.forName("UTF-8"));
        // 写出数据
        /**
         * 97
         * aaa
         * 我喜欢你hello
         */
        ps.println(97);
        ps.println("aaa");
        ps.printf("%s喜欢%s", "我", "你");
        ps.print("hello");
        // 释放资源
        ps.close();

    }
}
